﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SpeakupUI2
{
    /// <summary>
    /// Interaction logic for LegendControl.xaml
    /// </summary>
    public partial class LegendPanel : UserControl
    {
        public LegendPanel()
        {
            InitializeComponent();
        }

        public static readonly DependencyProperty AvailableBrushProperty;
        public static readonly DependencyProperty AvailableWaitListBrushProperty;
        public static readonly DependencyProperty ReservedBrushProperty;
        public static readonly DependencyProperty ReservedWaitListBrushProperty;

        static LegendPanel()
        {
            string[] propertyNames = { "AvailableBrush", 
                               "AvailableWaitListBrush",
                               "ReservedBrush", 
                               "ReservedWaitListBrush"};

            int propertyCount = 4;
            DependencyProperty [] properties  = new DependencyProperty[propertyCount];


            for (int i = 0; i < propertyCount; i++)
            {
                FrameworkPropertyMetadata metadata = new FrameworkPropertyMetadata();
                metadata.AffectsRender = true;
                metadata.DefaultValue = Brushes.LightGray;

                properties[i] = DependencyProperty.Register(propertyNames[i],
                                                                     typeof(Brush),
                                                                     typeof(LegendPanel),
                                                                     metadata);
            }

            AvailableBrushProperty          = properties[0];
            AvailableWaitListBrushProperty  = properties[1];
            ReservedBrushProperty           = properties[2];
            ReservedWaitListBrushProperty   = properties[3];
        }

        public Brush AvailableBrush 
        { 
            get
            {
                return (Brush)GetValue(AvailableBrushProperty);
            }
            set
            {
                SetValue(AvailableBrushProperty, value);
            }
        }       

        public Brush AvailableWaitListBrush 
        {
            get
            {
                return (Brush)GetValue(AvailableWaitListBrushProperty);
            }
            set
            {
                SetValue(AvailableWaitListBrushProperty, value);
            }
        }
        public Brush ReservedBrush 
        {
            get
            {
                return (Brush)GetValue(ReservedBrushProperty);
            }
            set
            {
                SetValue(ReservedBrushProperty, value);
            }
        }
        public Brush ReservedWaitListBrush 
        {
            get
            {
                return (Brush)GetValue(ReservedWaitListBrushProperty);
            }
            set
            {
                SetValue(ReservedWaitListBrushProperty, value);
            }
        }
    }
}
